在job預設的情況下,priority被設定在50, priority的範圍在1~100之間,數字越大優先權越高。
在job file內加入 priority
給予1~100的值
job "erp" {
priority = 66
group "webserver" {
count = 3
network {
port "http" {
to = 80
}
}
...
但是在有些job是無法生效的,如: batch job.
原來在Nomad server config內, 預設的sysbatch_scheduler_enabled
是false,
在server config 加入 default_scheduler_config
,並啟用 sysbatch_scheduler_enabled = true
,
設定範例:
server {
...
default_scheduler_config {
scheduler_algorithm = "spread"
memory_oversubscription_enabled = true
preemption_config {
system_scheduler_enabled = true
service_scheduler_enabled = true
sysbatch_scheduler_enabled = true
}
}
...
}